<?php

	include_once DIR_CONTROLLER		."loginCon.php";
	include_once DIR_MODEL			."loginMod.php";
	$login_con 	= new WS_LoginCon();

	$log_username 	= _POST('log_username');
	$log_password 	= _POST('log_password', false);
	$log_keep_login = _POST('log_keep_login', false);
	
	if ( isset($_POST['log_submit']) ) {
		$result = $login_con->login($log_username, $log_password, $log_keep_login);
		if ( $result['WB_Login'] == 'Y' ) {
			$_SESSION = $result;
			redirect('./');
		}
		else {
			$message  = $result['WB_Warning']; 
		}
	}
	else {
		$message = EN_USERPASS;
	}
	
	$TEMP->set_var(array('log_message' => $message));
?>